package design_principles.singleton_pattern.code;

public class demo {
    public static void main(String[] args) {
        int[] array={10,9,2,5,3,7,101,18};
        System.out.println(test(array));
        
    }

    public static int test(int[] array){
        //存储所有的上升子序长度
        int maxLength=0;
        int startIndex=0;
        int endIndex=1;
        int len=array.length;
        for(int i=0;i<len-1;i++){
            if(array[i]>=array[endIndex]){
                int tempLength=endIndex-startIndex+1;
                   if(tempLength>maxLength){maxLength=tempLength;}
                   startIndex=endIndex;
               }
            endIndex++;
 
           }
           return maxLength; 
    }
}